fix(server): parse git branches correctly when column.ui is enabled#1529
fix(server): parse git branches correctly when column.ui is enabled#1529juliusmarminge merged 3 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add coverage for `git branch` parsing when `column.ui=always` - Prevent merged branch names when Git formats output into columns
- Update the GitCore integration test to match the `branch --no-column` invocation - Covers the remote-branches failure path with the corrected command shape
|
thanks Julius for adding the tests 🫡 I admit I should have done that myself |
What Changed
Added the
--no-columnflag to git operations that support it (git branchonly here, if you ever need to parsegit tag/status/cleanat some point, you'll need to add that too).Reference : https://git-scm.com/docs/git-column
Why
Users (like myself) can have the setting


column.uiset toalwaysin their.gitconfig(for better readability), but this messes up with the branch parsing int3code.As you can see here, branches are put here "as-is", even tho they should be in separated lines.
Currently it parses
go-bin copilot/rewrite-cli-in-rustas one branch while they are two separate ones. The--no-columnflag fixes that :UI Changes
None.
Checklist
Note
Medium Risk
Changes
git branchinvocations to add--no-column, which could affect behavior on older Git versions or in environments where the flag is unsupported, but is otherwise a narrow parsing fix.Overview
Fixes branch name parsing in
GitCorewhen a user hascolumn.ui=alwaysby forcinggit branchoutput to be one-branch-per-line.Updates
listBranches(local and--remotes) andlistLocalBranchNamesto pass--no-column, and adds a regression test that reproduces multi-columngit branchoutput and asserts branch names are not concatenated.Written by Cursor Bugbot for commit 8fdae98. This will update automatically on new commits. Configure here.
Note
Fix git branch parsing when
column.uiis enabled by passing--no-columnWhen
column.uiis set toalwaysin git config,git branchoutputs multiple branch names per line, breaking line-by-line parsing. Adds--no-columnto allgit branchinvocations inGitCore.ts(listBranchesandlistLocalBranchNames) to force one-branch-per-line output regardless of git configuration.Macroscope summarized 8fdae98.